package com.ruoyi.testDeal.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.testDeal.domain.equInfo.JkDshshsjInfo;
import com.ruoyi.testDeal.service.IJkDshshsjInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 非煤带式输送机参数信息Controller
 * 
 * @author ruoyi
 * @date 2024-04-10
 */
@RestController
@RequestMapping("/testDeal/dshshsjinfo")
public class JkDshshsjInfoController extends BaseController
{
    @Autowired
    private IJkDshshsjInfoService jkDshshsjInfoService;

    /**
     * 查询非煤带式输送机参数信息列表
     */
    @PreAuthorize("@ss.hasPermi('testDeal:dshshsjinfo:list')")
    @GetMapping("/list")
    public TableDataInfo list(JkDshshsjInfo jkDshshsjInfo)
    {
        startPage();
        List<JkDshshsjInfo> list = jkDshshsjInfoService.selectJkDshshsjInfoList(jkDshshsjInfo);
        return getDataTable(list);
    }

    /**
     * 导出非煤带式输送机参数信息列表
     */
    @PreAuthorize("@ss.hasPermi('testDeal:dshshsjinfo:export')")
    @Log(title = "非煤带式输送机参数信息", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, JkDshshsjInfo jkDshshsjInfo)
    {
        List<JkDshshsjInfo> list = jkDshshsjInfoService.selectJkDshshsjInfoList(jkDshshsjInfo);
        ExcelUtil<JkDshshsjInfo> util = new ExcelUtil<JkDshshsjInfo>(JkDshshsjInfo.class);
        util.exportExcel(response, list, "非煤带式输送机参数信息数据");
    }

    /**
     * 获取非煤带式输送机参数信息详细信息
     */
    @PreAuthorize("@ss.hasPermi('testDeal:dshshsjinfo:query')")
    @GetMapping(value = "/{jkDshshsjId}")
    public AjaxResult getInfo(@PathVariable("jkDshshsjId") Long jkDshshsjId)
    {
        return success(jkDshshsjInfoService.selectJkDshshsjInfoByJkDshshsjId(jkDshshsjId));
    }

    /**
     * 新增非煤带式输送机参数信息
     */
    @PreAuthorize("@ss.hasPermi('testDeal:dshshsjinfo:add')")
    @Log(title = "非煤带式输送机参数信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody JkDshshsjInfo jkDshshsjInfo)
    {
        return toAjax(jkDshshsjInfoService.insertJkDshshsjInfo(jkDshshsjInfo));
    }

    /**
     * 修改非煤带式输送机参数信息
     */
    @PreAuthorize("@ss.hasPermi('testDeal:dshshsjinfo:edit')")
    @Log(title = "非煤带式输送机参数信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody JkDshshsjInfo jkDshshsjInfo)
    {
        return toAjax(jkDshshsjInfoService.updateJkDshshsjInfo(jkDshshsjInfo));
    }

    /**
     * 删除非煤带式输送机参数信息
     */
    @PreAuthorize("@ss.hasPermi('testDeal:dshshsjinfo:remove')")
    @Log(title = "非煤带式输送机参数信息", businessType = BusinessType.DELETE)
	@DeleteMapping("/{jkDshshsjIds}")
    public AjaxResult remove(@PathVariable Long[] jkDshshsjIds)
    {
        return toAjax(jkDshshsjInfoService.deleteJkDshshsjInfoByJkDshshsjIds(jkDshshsjIds));
    }
}
